/*左桐*/

//*********************模态框**************//
function CheckReserve1(form1) {
	var x = true;
	if(form1.babyname1.value == '姓名' || form1.babyname1.value == '') {
		alert("请填写姓名");
		x = false;
		return false;
		form1.babyname1.select();
	} else {

	var str = form1.babyname1.value;
		for(var i = 0; i < str.length; i++) {
			if(str.indexOf(i.toString()) != -1) {
				alert("名字不合法！");
				x = false;
				return false;
				form1.babyname1.select();
			}
		}
		if(/[~#^$@%&!*+-=/]/gi.test(str)) {
			alert("名字不合法！");
			x = false;
			return false;
			form1.babyname1.select();
		}

	}

	if(form1.Telephone1.value == '手机号码' || form1.Telephone1.value == '') {
		alert("请填写您的电话");
		x = false;
		return false;
		form1.Telephone1.select();
	} else {

		if(!(/^1[34578]\d{9}$/.test(form1.Telephone1.value))) {
			alert("请输入正确的手机号");
			form1.Telephone1.select();
			x = false;
			return(false);
		}

	}	
	if(form1.province1.value === ""||form1.province1.value == '城市') {
		console.log(44)
		alert("请填写城市");
		x = false;
		return false;
		form1.province1.select();
	}
	
		var $name1 = $(".name1").val();
		var $phone1 = $(".phone1").val();
		var $province1 = $(".province1").val();
		var data = {
				name:$name1,
				phone:$phone1,
				//province:$province,
				//pro:$from,
				from :4,
				client:'youjiaolvyou_web'
		};
		console.log(data);	
		function ajaxclick(){
			$.ajax({
				url:"/Mess/Send/tmc_save",
			    data:{
					name:$name1,
					phone:$phone1,
					//pro:$from,
					from :4,
					client:'youjiaolvyou_web'
				},
				type:"POST",
				success:function(rs){
					if(rs){
						alert("提交成功");
						$('#message-form2')[0].reset();
//						修改
						$(".am-close-spin").trigger("click");
//						修改
//						$(".am-active").hide();
//						$(".am-dimmer").hide();
//						$("#doc-modal-1").hide();
					}else if(rs.rs=="error"){						
						}
					},
				error:function(){					
					}
				})
			}
		ajaxclick()		
	

//	console.log(data);
};
